from tkinter import filedialog

AllFileDist = ('所有文件','.*')

PictureDist = [
    ('JPG文件',['.jpg','.jiff','.jpeg']),
    ('PNG文件',['.png','.pneg']),
    ('矢量图形文件',['.bmp','.svg']),
    ('PhotoShop文件',['.PSD','.PDD']),
    ('动图',['.gif']),
    AllFileDist
]

VideoDist = [
    ('MP4文件',['.mp4','.m4a','.mov','.avi','.rmvb','.flv','.3GP','.wmv','asf','.mpeg',
    '.ra','.ram','.ts','.mkv','.f4v','.ogv','.qtm','.str','.amc','.dvx','.evo','.dv']),
    
]

def PictureAskFiles():
    return filedialog.askopenfilenames(filetypes=PictureDist)

def VideoAskFiles():
    return filedialog.askopenfilenames(filetypes=VideoDist)

def directoryBox(title=None, dirName=None):
        options = {}
        options['initialdir'] = dirName
        options['mustexist'] = False
        fileName = filedialog.askdirectory(**options)
        if fileName == "":
            return None
        else:
            return fileName

if __name__ == '__main__':
    directoryBox(title='q',dirName='?')